<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<script language="javascript" type="text/javascript"
	src="/card/common/common.js"></script>
<script type="text/javascript" language="javascript"
	src="/card/common/levelone.js"></script>
<script type="text/javascript" language="javascript" src="leveltwo.js"></script>
<script type="text/javascript" language="javascript"
	src="/card/common/level_init.js"></script>
<title>石家庄一卡通有限公司_商户信息更新</title>
<link href="/card/images/css.css" rel="stylesheet" type="text/css">

</head>

<!-- FCKeditor 2.6.5-->	
<script type="text/javascript" src="/card/fckeditor/fckeditor.js"></script>
<script type="text/javascript" language="javascript">
	//加载CKEditor
	window.onload = function() {		
		var fileContentTArea = document.getElementById("newscontent");		
		var editor = new FCKeditor('mdesc','100%','400');
		editor.BasePath = "/card/fckeditor/";
		editor.ReplaceTextarea();		
	}
	</script>
	
<body>
<table width="945" border="0" align="center" cellpadding="0"
	cellspacing="0">
	<tr>
		<td><img src="/card/images/index_02.jpg" width="945" height="93" /></td>
	</tr>
</table>
<table width="945" border="0" align="center" cellpadding="0"
	cellspacing="0">
	<tr>
		<td valign="top"><img src="/card/images/index_04.jpg" width="945"
			height="5" /></td>
	</tr>
</table>
<table width="945" border="0" align="center" cellpadding="0"
	cellspacing="0">
	<tr>
		<td width="21"><img src="/card/images/index_06.jpg" width="21"
			height="32" /></td>
		<td width="903" background="/card/images/index_08.jpg">
		<div align="center"><script type="text/javascript"
			language="javascript">
	initLevelOne();
</script></div>
		</td>
		<td width="21"><img src="/card/images/index_07.jpg" width="21"
			height="32" /></td>
	</tr>
</table>
<table width="945" height="15" border="0" align="center" cellpadding="0"
	cellspacing="0">
	<tr>
		<td></td>
	</tr>
</table>
<table width="945" border="0" align="center" cellpadding="0"
	cellspacing="0">
	<tr>
		<td><script type="text/javascript">
	var pic_width = 945
	var pic_height = 198
	var text_height = 0
	var swfpath = '/card/images/focus.swf'
	var swf_height = pic_height + text_height
	var pics = '/card/images/q1.jpg|/card/images/q2.jpg|/card/images/q3.jpg|/card/images/q4.jpg'
	var links = '#|#|#|#'
	var texts = '||'
	document
			.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'
					+ pic_width + '" height="' + swf_height + '">');
	document
			.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="' + swfpath + '"><param name="quality" value="high"><param name="bgcolor" value="#ffffff">');
	document
			.write('<param name="menu" value="false"><param name=wmode value="opaque">');
	document.write('<param name="FlashVars" value="pics=' + pics + '&links='
			+ links + '&texts=' + texts + '&borderwidth=' + pic_width
			+ '&borderheight=' + pic_height + '&textheight=' + text_height
			+ '">');
	document
			.write('<embed src="'
					+ swfpath
					+ '" wmode="opaque" FlashVars="pics='
					+ pics
					+ '&links='
					+ links
					+ '&texts='
					+ texts
					+ '&borderwidth='
					+ pic_width
					+ '&borderheight='
					+ pic_height
					+ '&textheight='
					+ text_height
					+ '" menu="false" bgcolor="#ffffff" quality="high" width="'
					+ pic_width
					+ '" height="'
					+ pic_height
					+ '" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
</script>

		</td>
	</tr>
</table>
<table width="945" height="15" border="0" align="center" cellpadding="0"
	cellspacing="0">
	<tr>
		<td></td>
	</tr>
</table>
<style type="text/css">
.code {
	background-image: url(code.jpg);
	font-family: Arial;
	font-style: italic;
	color: Red;
	border: 0;
	padding: 2px 3px;
	letter-spacing: 3px;
	font-weight: bolder;
}

.unchanged {
	border: 0;
}

</style>

<script type="text/javascript">
	var code; //在全局 定义验证码
	function createCode() {
		code = "";
		var codeLength = 6;//验证码的长度
		var checkCode = document.getElementById("checkCode");
		var selectChar = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c',
				'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
				'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z');//所有候选组成验证码的字符，当然也可以用中文的

		for ( var i = 0; i < codeLength; i++) {

			var charIndex = Math.floor(Math.random() * 36);
			code += selectChar[charIndex];

		}
		//  alert(code);
		if (checkCode) {
			checkCode.className = "code";
			checkCode.value = code;
		}

	}

	function validate() {
		var inputCode = document.getElementById("yanzh").value;
		if (inputCode.length <= 0) {
			alert("请输入验证码！");
			return false;
		} else if (inputCode != code) {
			alert("验证码输入错误！");
			createCode();//刷新验证码
			return false;
		} else {
			return true;
		}

	}
</script>

<td>&nbsp;</td>
<td width="668" valign="top">
<table width="945" height="25" border="0" align="center" cellpadding="0"
	cellspacing="0">
	<tr>
		<td width="179" background="/card/images/index_26.jpg">
		<div align="center" class="baid">商户信息</div>
		</td>
		<td background="/card/images/index_29.jpg">&nbsp;</td>
		<td background="/card/images/index_29.jpg">&nbsp;</td>
	</tr>
</table>
<form action="${cardPath}/update1_Merch.action" name="merch" method="post">
<table width="945" border="0" align="center" cellpadding="0"
	cellspacing="0">
	<tr>
		<td class="hei"  ><strong>商户名称：</strong>${merch.mname }
		<font color="blue"><input type="hidden" name="merch.mname" value="${merch.mname}" /></font>
		</td>		
	</tr>	
	<tr>
        <td class="hei"><strong>密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码：</strong>
        	<input type=password name="merch.mpwd"  id="merch.mpwd" value="${merch.mpwd}" /><font color=red>*</font>
        </td>
    </tr>
	<tr>
		<td class="hei" ><strong>商户描述：</strong></td>
	</tr>
	<tr>
		<td class="hei" align="left" colspan="3"><textarea name="merch.mdesc" id="mdesc" rows="20" cols="100" >${ merch.mdesc}</textarea></td>
	</tr>
	<tr>
		<td class="hei" align="left" width="30%"><strong>商户地址：</strong>
			<input id="merch.maddr" name="merch.maddr" value="${merch.maddr}" size="50" /></td>
	</tr>	
	<tr>
		<td class="hei" align="left" width="30%" ><strong>商户电话：</strong>
		<input id="merch.mphone" name="merch.mphone" value="${merch.mphone }" size="40" /></td>
	</tr>
	<tr>
		<td class="hei" align="left"  width="30%" ><strong>商户电邮：</strong>
		<input id="merch.memail" name="merch.memail" value="${merch.memail}" size="40"/>
		</td>	
	</tr>	
	<tr>
		<td class="hei" align="left" width="45%" ><strong>验证码:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong>
			<input type="text" id="yanzh"	onclick="createCode();" style="BORDER: 1px solid #9FC5BF" size="20" />
			<input type="text" id="checkCode" class="unchanged" style="width: 80px" readonly/>
		</td>		
	</tr>
	<tr align="center">
		<td class="hei" align="center">
			<input type="button" onclick="updateMerch();" value="保存" />
<input type="button" value="关闭当前窗口"  onclick="if(confirm('关闭当前窗口吗？')){window.close();}" />
</td>
	</tr>
</table>
<input type="hidden" name="merch.mid" value="${merch.mid} "/>
<input type="hidden" name="merch.mstat" value="${merch.mstat} "/>
</form>
<script type="text/javascript">
	var stat = ${merch.mstat};
	if (stat == 1) {
		document.getElementById("stat").checked = "true";
	}
	function updateMerch() {
		if(document.getElementById('merch.mpwd').value.trim()==''){
			alert('更新密码不能为空！');
			document.getElementById('merch.mpwd').focus();
			return ;
		}
		if(document.getElementById('merch.maddr').value.trim()==''){
			alert('更新地址不能为空！');
			document.getElementById('merch.maddr').focus();
			return ;
		}
		var phone = document.getElementById('merch.mphone'); 
		if(phone.value.trim() == ''){
			alert('更新电话不能为空！');
			phone.focus();
			return;
		}
		//电话格式检查
		if((!/^([0-9]{3,4}-)?[0-9]{8}$/g.test(phone.value.trim()))
				&& (!/^[0-9]{11}$/g.test(phone.value.trim()))){
			alert("固定电话的格式必须为【区号-8位有效数字】或【8位有效数字】\n"
					+ "手机电话的格式必须为11位有效数字,请检查！");		
			phone.focus();
			return;
		}		 
		if(document.getElementById("merch.memail").value.indexOf('@')<1){
		     alert('请填写正确的EMAIL！');
			 document.getElementById("merch.memail").focus();
			 return ;
		}
       if (!validate()) {
			return false;
       }
		var msg = "请再次确认您的注册信息，以确保我们及时与您联系。如正确无误则点击[确认]按钮!";
		if(confirm(msg)){			
			document.forms["merch"].submit();
			return true;
		}			
	}
</script>
<table width="945" border="0" align="center" cellpadding="0"
	cellspacing="0">
	<tr>
		<td>&nbsp;</td>
	</tr>
</table>
<table width="945" border="0" align="center" cellpadding="0"
	cellspacing="0">
	<tr>
		<td width="108" height="105">
		<div align="center"><img src="images/logo.jpg" width="52"
			height="64" /></div>
		</td>
		<td width="837">
		<div align="center" class="di">石家庄一卡通卡有限公司 （2009-2010）版权所有
		技术支持:网讯科技 冀ICP备05035382号 <br />
		电话：86－0311－88611099 传真：86－0311－88611099 邮箱:ncckefu@163.com<br />
		地址:石家庄市中山西路83号东方大厦1418室</div>
		</td>
	</tr>
</table>
</body>
</html>
